﻿using System;
using System.Threading;
using NUnit;
using NUnit.Framework;
using NL.ADA.ConfigProxy;


namespace NL.ADA.ConfigClient.NUnit
{
    [TestFixture]
    public class UnitTestConfigurationManager
    {
        [Test]
        public void GetAppSettings_Test()
        {
            var coll = ConfigurationManager<object>.AppSettings;
            Assert.That(coll.Count > 0);
            int number = ConfigurationManager<int>.AppSettings["number"];
        }
        [Test]
        public void GetIntegerConfigValue_Test()
        {
            //var tempKey = DateTime.Now.Ticks.ToString();
            //var gateWay = new AdminServiceGateway();
            //int testIntValueFalse = ConfigurationManager.AppSettings["MyFavouriteInteger" + tempKey];
            //Assert.That(string.IsNullOrEmpty(testIntValueFalse));
            //int result = gateWay.InsertConfig(0, 9, "MyFavouriteInteger" + tempKey, "9", 1, String.Empty, 1);
            //Assert.That(result > 0);
            //Thread.Sleep(5000);
            ////int checkNormalConfigurationManager =System.Configuration.ConfigurationManager.AppSettings["test"];
            //string testIntValueTrue = ConfigurationManager.AppSettings["MyFavouriteInteger" + tempKey];
            //Assert.That(!string.IsNullOrEmpty(testIntValueTrue));
        }

    }
}
